Skip to content

Accept case-insensitive event-stream media types - #481

Open
Twiink wants to merge 1 commit into
replicate:mainfrom
Twiink:fix/stream-media-type-20261127-r3
Open

Twiink wants to merge 1 commit into
replicate:mainfrom
Twiink:fix/stream-media-type-20261127-r3

Conversation

@Twiink

@Twiink Twiink commented Nov 27, 2026

Copy link
Copy Markdown

Both stream and async_stream reject a successful event response carrying Content-Type: Text/Event-Stream; charset=utf-8. HTTP media type names are case-insensitive. RFC 9110, section 8.3.1

Normalize the media type before checking it and keep the received spelling in the error message. The new tests consume the event through the sync and async iterators and check that an unrelated media type is still rejected.

Both mixed-case regressions failed on the baseline. The local suite passed with 161 tests and 6 skipped. Ruff lint and format checks on both changed files passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant